package com.ruoyi.cderp.service.impl;

import java.util.List;

import com.ruoyi.cderp.domain.BaseDataProductBrand;
import com.ruoyi.cderp.domain.BaseDataProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cderp.mapper.TblProductStockMapper;
import com.ruoyi.cderp.domain.TblProductStock;
import com.ruoyi.cderp.service.ITblProductStockService;

/**
 * 商品库存Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-01
 */
@Service
public class TblProductStockServiceImpl implements ITblProductStockService
{
    @Autowired
    private TblProductStockMapper tblProductStockMapper;

    /**
     * 查询商品库存
     *
     * @param id 商品库存主键
     * @return 商品库存
     */
    @Override
    public TblProductStock selectTblProductStockById(String id)
    {
        return tblProductStockMapper.selectTblProductStockById(id);
    }

    /**
     * 查询商品库存列表
     *
     * @param tblProductStock 商品库存
     * @return 商品库存
     */
    @Override
    public List<TblProductStock> selectTblProductStockList(TblProductStock tblProductStock)
    {
        return tblProductStockMapper.selectTblProductStockList(tblProductStock);
    }

    /**
     * 新增商品库存
     *
     * @param tblProductStock 商品库存
     * @return 结果
     */
    @Override
    public int insertTblProductStock(TblProductStock tblProductStock)
    {
        return tblProductStockMapper.insertTblProductStock(tblProductStock);
    }

    /**
     * 修改商品库存
     *
     * @param tblProductStock 商品库存
     * @return 结果
     */
    @Override
    public int updateTblProductStock(TblProductStock tblProductStock)
    {
        return tblProductStockMapper.updateTblProductStock(tblProductStock);
    }

    /**
     * 批量删除商品库存
     *
     * @param ids 需要删除的商品库存主键
     * @return 结果
     */
    @Override
    public int deleteTblProductStockByIds(String[] ids)
    {
        return tblProductStockMapper.deleteTblProductStockByIds(ids);
    }

    /**
     * 删除商品库存信息
     *
     * @param id 商品库存主键
     * @return 结果
     */
    @Override
    public int deleteTblProductStockById(String id)
    {
        return tblProductStockMapper.deleteTblProductStockById(id);
    }

    @Override
    public List<BaseDataProductCategory> category() {
        return tblProductStockMapper.category();
    }

    @Override
    public List<BaseDataProductBrand> brand() {
        return tblProductStockMapper.brand();
    }
}
